package zlatan_demo11_foreach
//映射扁平化(flatmap)
object ClassDemo04 {
  def main(args: Array[String]): Unit = {
    val list1=List("hadoop hive spark flink flume","kudu hbase sqoop storm")

    //获取到文本的没一个单词，并将每一个单词都放到列表中
    //先map,在flatten
    val list2=list1.map((i)=>{i.split(" ")})
    println(list2)
    val list3=list2.flatten
    println(s"list3${list3}")
    //flatmap
    val list4=list1.flatMap(_.split(" "))
     println(list4)
  }

}
